home *** CD-ROM | disk | FTP | other *** search
/ boe.pres.k12.wv.us / boe.pres.k12.wv.us.zip / boe.pres.k12.wv.us / Utilities / Xerox Workcentre 5335 / Windows Scan / 64-bit_x64 / Russian / cpsimage.cab / data / xps / XpsSequence.elf < prev   
Text File  |  2009-04-23  |  2KB  |  66 lines

  1. #load "xps/XpsDocument.elf";
  2.  
  3. /****************************************************************************/
  4. /*
  5. ** This class defines a XPS FixedDocumentSequence part.
  6. */
  7. /* @appendDocument Appends a XpsDocument to end of document list. */
  8. /* @getDocument Gets the specified XpsDocument from document list. */
  9. /* @getDocumentCount Gets the number of XpsDocument objects in document list. */
  10. /* @insertDocument Inserts a XpsDocument into document list. */
  11. /* @prependDocument Prepends a XpsDocument to beginning of document list. */
  12. /* @removeDocument Removes the specified XpsDocument from document list. */
  13. /****************************************************************************/
  14. CLASS XpsSequence EXTENDS XpsPackagePart {
  15.    // Fields
  16.    LIST documents;
  17.  
  18.    // Methods
  19.    METHOD insertDocument (INTEGER docNum, XpsDocument doc) {
  20.       INTEGER docCount = this.documents.length ();
  21.  
  22.       if ((docNum < 1) || (docNum > docCount+1)) {
  23.          SetStatus (
  24.              op: "stop",
  25.             msg: "Invalid document number <" + docNum + ">\n"
  26.             );
  27.          return;
  28.          }
  29.  
  30.       this.documents.insert (entry: docNum-1, obj: doc);
  31.    }
  32.  
  33.    METHOD prependDocument (XpsDocument doc) {
  34.       this.insertDocument (doc: doc, docNum: 1);
  35.    }
  36.  
  37.    METHOD appendDocument (XpsDocument doc) {
  38.       INTEGER docCount = this.documents.length ();
  39.       this.insertDocument (doc: doc, docNum: docCount+1);
  40.    }
  41.  
  42.    METHOD removeDocument (INTEGER docNum) {
  43.       this.documents.remove (entry: docNum-1);
  44.    }
  45.  
  46.    METHOD getDocumentCount ()
  47.      RETURNS (INTEGER count) {
  48.       count = this.documents.length ();
  49.    }
  50.  
  51.    METHOD getDocument (INTEGER docNum)
  52.      RETURNS (XpsDocument doc) {
  53.       INTEGER docCount = this.documents.length ();
  54.  
  55.       if ((docNum < 1) || (docNum > docCount)) {
  56.          SetStatus (
  57.              op: "stop",
  58.             msg: "Invalid document number <" + docNum + ">\n"
  59.             );
  60.          return;
  61.          }
  62.  
  63.       doc = this.documents[docNum-1];
  64.    }
  65. }
  66.